package com.topvision.face.util;

import com.google.gson.Gson;

public class GsonUtil {
	
	//将bean转换成Json字符串：
	public static String beanToJSONString(Object bean) {
	    return new Gson().toJson(bean);
	}
	 

	//将Json字符串转换成对象：
	public static Object JSONToObject(String json, Class beanClass) {
	    Gson gson = new Gson();
	    Object res = gson.fromJson(json, beanClass);
	    return res;
	}

}
